<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateAdminsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id')->comment('唯一ID');
            $table->string('name', 191)->default('')->comment('管理员名称');
            $table->string('email', 191)->unique('users_email_unique')->comment('管理员邮箱');
            $table->string('avatar')->default('')->comment('管理员头像');
            $table->string('password', 191)->comment('管理员密码');
            $table->string('remember_token', 100)->nullable()->comment('记住登陆密码');
            $table->boolean('status')->default(10)->comment('管理员状态【10 启用 0 停用 -1 删除】');
            $table->dateTime('last_login_time')->comment('最后登录时间');
            $table->string('last_login_ip', 20)->default('')->comment('最后登录IP');
            $table->dateTime('created_at')->comment('创建时间');
            $table->dateTime('updated_at')->comment('修改时间');
        });

        DB::statement("ALTER TABLE `admins` comment '管理员信息表'");
    }


    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('admins');
    }

}
